<!doctype html>
<html lang="en" class="fixed">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <title>学员单页-收费记录</title>
    <link rel="apple-touch-icon" sizes="120x120" href="favicon/apple-icon-120x120.png">
    <link rel="icon" type="image/png" sizes="192x192" href="favicon/android-icon-192x192.png">
    <link rel="icon" type="image/png" sizes="32x32" href="favicon/favicon-32x32.png">
    <link rel="icon" type="image/png" sizes="16x16" href="favicon/favicon-16x16.png">
    <link rel="stylesheet" type="text/css"
          href="<?php xcho(loadSource('/assets/plugins/bootstrap/css/bootstrap.min.css')) ?>">
    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/plugins/animate.css/animate.css')) ?>">
    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/plugins/font-awesome/css/font-awesome.css')) ?>">
    <link rel="stylesheet"
          href="<?php xcho(loadSource('/assets/plugins/data-table/media/css/dataTables.bootstrap.min.css')) ?>">
    <link rel="stylesheet" href="<?php xcho(loadSource('/app/css/style.css')) ?>">
    <link rel="stylesheet" href="<?php xcho(loadSource('/app/css/app.css')) ?>">
    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/css/new_main.css')) ?>">
    
    <style>
        *{
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        ul,li,ol,li{
            list-style: none;
        }
        .content-cont{
            /*width: 1200px;*/
            background: #fff;
            margin: 0 auto;
        }
        .content-cont .cont-title{
            padding: 10px 0 5px;
            border-bottom: 1px #ccc solid;
        }
        .content-cont .cont-title h2{
            font-size: 16px;
            padding-left: 20px;
            display: inline-block;
        }
        .content-cont .cont-title h2 button{
            padding: 6px 14px;
            background: rgba(226,175,8,.6);
            border: none;
            box-shadow: 0 0 5px #ccc;
            border-radius: 5px;
            font-size: 10px;
            color: #fff;
            margin-left: 80px;
        }
        .content-cont .cont-title ol{
            padding: 10px 20px;
            display: inline-block;
        }
        .content-cont .cont-title ol li{
            display: inline-block;
            margin: 0 5px;
        }
        .content-cont .cont-title ol li button{
            padding: 4px 10px;
            border: none;
            border-radius: 5px;
            color:#fff;
            font-size: 12px;
            background: #1ab394;
        }
        .content-cont .cont-title ul{
            float: right;
            padding: 10px 20px;
        }
        .content-cont .cont-title ul li{
            display: inline-block;
            margin: 0 5px;
        }
        .content-cont .cont-title ul li button{
            padding: 4px 10px;
            border: none;
            border-radius: 5px;
            color:#fff;
            font-size: 12px;
            background: #1ab394;
        }
        .content-cont .cont-title ul li:nth-of-type(3) button{
            background: rgba(215,82,52,.6);
        }
        .content-cont .cont{
            padding: 20px;
        }
        .content-cont .cont ul.list{
            display: inline-block;
            border: 1px #eee solid;
            float: left;
        }
        .content-cont .cont ul.list li{
            line-height: 30px;
            font-size: 12px;
            padding: 0 16px;
            border-bottom: 1px #eee solid;
            cursor: pointer;
        }
        .content-cont .cont ul.list li.active{
            background: #E7F4FD;
            color:#3F93EC;
        }
        /*.content-cont .cont ul.list li:nth-of-type(3){*/
            /*border-bottom: none;*/
        /*}*/
        .content-cont .cont .cont-tab{
            display: inline-block;
            margin-left: 20px;
            width: 80%;
        }
        .content-cont .cont .cont-tab>div{
            /*display: none;*/
            width: 100%;
        }
        /*---------------baseMessage------------------*/
        .content-cont .cont .cont-tab>div.baseMessage{
            display: inline-block;
        }
        .content-cont .cont .cont-tab .baseMessage .basemess h3{
            font-size: 18px;
        }
        .content-cont .cont .cont-tab .baseMessage .basemess table{
            width: 100%;
        }
        .content-cont .cont .cont-tab .baseMessage .basemess table tr{
            line-height: 30px;
            font-size: 10px;
            color: #333;
        }
        .content-cont .cont .cont-tab .baseMessage .basemess table tr td{
            width: 33%;
        }

        /*-----------------follow-record--------------------*/
        .content-cont .cont .cont-tab .follow-record .basemess h3{
            font-size: 18px;
        }
        .content-cont .cont .cont-tab .follow-record .basemess table tr td span{
            margin-left: 40px;
        }
        .content-cont .cont .cont-tab .follow-record .basemess .basemess-record{
            padding: 20px;
            border: 1px #ccc solid;
        }
        .content-cont .cont .cont-tab .follow-record .basemess .basemess-record select{
            width: 60px;
            border: 1px #ccc solid;
            border-radius: 5px;
            height: 24px;
        }
        .content-cont .cont .cont-tab .follow-record .basemess .basemess-record input{
            width: 120px;
            border: 1px #ccc solid;
            border-radius: 5px;
        }
        .content-cont .cont .cont-tab .follow-record .basemess .basemess-record select:nth-of-type(1){
            width: 160px;
            border: 1px #ccc solid;
            border-radius: 5px;
            height: 24px;
        }
        .content-cont .cont .cont-tab .follow-record .basemess .basemess-record span:nth-of-type(2){
            margin-left: 30px;
        }
        .content-cont .cont .cont-tab .follow-record .basemess .basemess-record div{
            margin-top: 10px;
        }
        .content-cont .cont .cont-tab .follow-record .basemess .basemess-record div p{
            float: left;
        }
        .content-cont .cont .cont-tab .follow-record .basemess .basemess-record div textarea{
            resize: none;
            border: 1px #ccc solid;
        }
        .content-cont .cont .cont-tab .follow-record .basemess .basemess-record button{
            padding: 4px 14px;
            border: none;
            border-radius: 5px;
            background: #1ab394;
            color:#fff;
            font-size: 12px;
            margin-left: 64px;
        }
        .content-cont .cont .cont-tab .follow-record .top_pages{
            padding: 3px 15px;
            height: 30px;
            margin-top: 8px;
            font-size: 0;
        }
        .content-cont .cont .cont-tab .follow-record .top_pages p{
            display: inline-block;
            font-size: 12px;
        }
        .content-cont .cont .cont-tab .follow-record .top_pages ul{
            font-size: 0;
            display: inline-block;
            float: right;
        }
        .content-cont .cont .cont-tab .follow-record .top_pages ul li:nth-of-type(1){
            width: 120px;
            border:none;
            background: none;
        }
        .content-cont .cont .cont-tab .follow-record .top_pages ul li:nth-of-type(1):hover{
            background: none;
            color:#999;
        }
        .content-cont .cont .cont-tab .follow-record .top_pages ul li{
            display: inline-block;
            font-size: 12px;
            width: 24px;
            height: 24px;
            background: #fff;
            margin-left: 10px;
            line-height: 24px;
            text-align: center;
            border: 1px #ccc solid;
            border-radius: 6px;
            cursor: pointer;
            color:#999;
        }
        .content-cont .cont .cont-tab .follow-record .top_pages ul li:last-child{
            width: 120px;
            border:none;
            background: none;
        }
        .content-cont .cont .cont-tab .follow-record .top_pages ul li:last-child input{
            width: 50px;
            margin: 0 10px;
            border-radius: 6px;
            border: none;
            border:1px #ccc solid;
            outline: none;
        }
        .content-cont .cont .cont-tab .follow-record .top_pages ul li:last-child:hover{
            background: none;
            color:#999;
        }
        .content-cont .cont .cont-tab .follow-record .top_pages ul li:hover{
            background: #108EE9;
            color:#fff;
        }
        .content-cont .cont .cont-tab .follow-record .table{
            width: 100%;
            margin-top: 10px;
        }
        .content-cont .cont .cont-tab .follow-record .table table{
            width: 100%;
        }
        .content-cont .cont .cont-tab .follow-record .table table thead tr th{
            padding: 10px;
            background: #1ab394;
            color:#fff;
            text-align: center;
        }
        .content-cont .cont .cont-tab .follow-record .table table thead tr th:nth-of-type(1) span{
            display: inline-block;
            width: 12px;
            height: 12px;
            border:1px #888 solid;
            background: #fff;
            margin-right: 20px;
            position: relative;
            cursor: pointer;
        }
        .content-cont .cont .cont-tab .follow-record .table table thead tr th:nth-of-type(1) span b{
            position: absolute;
            left: 28%;
            top:-60%;
        }
        .content-cont .cont .cont-tab .follow-record .table table tbody tr{
            border-bottom: 1px #ccc solid;
        }
        .content-cont .cont .cont-tab .follow-record .table table tbody tr:nth-of-type(even){
            background: rgba(238,238,238,.5);
        }
        .content-cont .cont .cont-tab .follow-record .table table tbody tr td{
            padding: 8px;
            border-bottom: 1px #eee solid;
            text-align: center;
        }
        .content-cont .cont .cont-tab .follow-record .table table tbody tr td:nth-of-type(2){
            color:#108EE9;
        }
        .content-cont .cont .cont-tab .follow-record .table table tbody tr td:last-child span{
            margin: 0 5px;
            color:#777;
            position: relative;
            cursor: pointer;
        }
        .content-cont .cont .cont-tab .follow-record .table table tbody tr td:last-child span b{
            width: 40px;
            line-height: 24px;
            background: #fff;
            position: absolute;
            bottom: -25px;
            left: -15px;
            font-weight: normal;
            font-size: 10px;
            color:#000;
            border: 1px #ccc solid;
            border-radius: 5px;
            display: none;
        }
        .content-cont .cont .cont-tab .follow-record .bottom_pages{
            padding: 3px 15px;
            height: 30px;
            margin-top: 8px;
            background: #fff;
            font-size: 0;
        }
        /*----------------------he-course-----------------*/
        .content-cont .cont .cont-tab>div.he-course{
            width: 100%;
        }
        .content-cont .cont .cont-tab>div.he-course ul{
            border-bottom: 1px #eee solid;
        }
        .content-cont .cont .cont-tab>div.he-course ul li{
            display: inline-block;
            width: 80px;
            text-align: center;
            cursor: pointer;
        }
        .content-cont .cont .cont-tab>div.he-course ul li.active{
            border-bottom: 2px #1ab394 solid;
            color:#1ab394;
        }
        .content-cont .cont .cont-tab>div.he-course .heCourse-cont>div{
            display: none;
        }
        .content-cont .cont .cont-tab>div.he-course .heCourse-cont>div:nth-of-type(1){
            display: block;
        }
        .content-cont .cont .cont-tab>div.he-course .heCourse-cont>div table{
            width: 100%;
        }
        .content-cont .cont .cont-tab>div.he-course .heCourse-cont>div table thead tr{
            background: #1ab394;
        }
        .content-cont .cont .cont-tab>div.he-course .heCourse-cont>div table thead tr th{
            padding: 10px 0;
            color:#fff;
            text-align: center;
        }
        .content-cont .cont .cont-tab>div.he-course .heCourse-cont>div table tbody tr{

        }
        .content-cont .cont .cont-tab>div.he-course .heCourse-cont>div table tbody tr:nth-of-type(even){
            background: rgba(238,238,238,.5);
        }
        .content-cont .cont .cont-tab>div.he-course .heCourse-cont>div table tbody tr td{
            padding: 6px 0;
            text-align: center;
            color:#333;
        }
        /*---------------schedule------------------*/
        .content-cont .cont .cont-tab>div.schedule button{
            padding: 4px 14px;
            border: none;
            border-radius: 5px;
            background: #1ab394;
            color:#fff;
            font-size: 12px;
            margin-left: 10px;
        }
        .content-cont .cont .cont-tab>div.schedule h4{
            display: inline-block;
            margin-left: 200px;
        }
        .content-cont .cont .cont-tab>div.schedule table{
            width: 100%;
        }
        .content-cont .cont .cont-tab>div.schedule table thead tr{
            border-bottom: 3px #eee solid;

        }
        .content-cont .cont .cont-tab>div.schedule table thead tr th{
            text-align: center;
            padding: 10px 0;
        }
        .content-cont .cont .cont-tab>div.schedule table tbody tr{
            border-bottom: 3px #eee solid;
        }
        .content-cont .cont .cont-tab>div.schedule table tbody tr span{
            color:#333;
        }
        .content-cont .cont .cont-tab>div.schedule table tbody tr span b{
            padding: 4px 8px;
            font-weight: normal;
            font-size: 12px;
            color: #fff;
            background: #1ab394;
            border-radius: 5px;
        }
        .content-cont .cont .cont-tab>div.schedule table tbody tr ul{
            margin-top: 6px;
            padding: 4px 10px;
        }
        .content-cont .cont .cont-tab>div.schedule table tbody tr td:nth-of-type(even) ul:nth-of-type(odd){
            background: rgba(238,238,238,.5);
        }
        .content-cont .cont .cont-tab>div.schedule table tbody tr td:nth-of-type(odd) ul:nth-of-type(even){
            background: rgba(238,238,238,.5);
        }
        .content-cont .cont .cont-tab>div.schedule table tbody tr td{
            vertical-align: initial;
            padding: 10px 0;
        }
        .content-cont .cont .cont-tab>div.schedule table tbody tr td ul li{
            line-height: 24px;
            font-size: 12px;
        }
        .content-cont .cont .cont-tab>div.schedule table tbody tr td ul li:nth-of-type(3){
            color:#108EE9;
        }
        /*---------------reviseLog------------------*/
        .content-cont .cont .cont-tab>div.reviseLog table{
            width: 100%;
        }
        .content-cont .cont .cont-tab>div.reviseLog table thead tr{
            background: #1ab394;
        }
        .content-cont .cont .cont-tab>div.reviseLog table thead tr th{
            padding: 10px 0;
            color:#fff;
            text-align: center;
        }
        .content-cont .cont .cont-tab>div.reviseLog table tbody tr{

        }
        .content-cont .cont .cont-tab>div.reviseLog table tbody tr:nth-of-type(even){
            background: rgba(238,238,238,.5);
        }
        .content-cont .cont .cont-tab>div.reviseLog table tbody tr td{
            padding: 6px 0;
            text-align: center;
            color:#333;
        }
        /*------------------charge-record----------------*/
        .content-cont .cont .cont-tab .charge-record table tbody tr td:last-child span{
            margin: 0 5px;
            color:#777;
            position: relative;
            cursor: pointer;
        }
        .content-cont .cont .cont-tab .charge-record table tbody tr td:last-child span b{
            width: 40px;
            line-height: 24px;
            background: #fff;
            position: absolute;
            bottom: -25px;
            left: -15px;
            font-weight: normal;
            font-size: 10px;
            color:#000;
            border: 1px #ccc solid;
            border-radius: 5px;
            display: none;
        }
    </style>
</head>

<body><?php include_once TPL_PATH . 'public/nav.phtml'; ?>
<div class="wrap">
    <div class="page-body" style="padding: 0">
        <div class="content" style="margin: 0;background: #F4F4F4">
            <div class="content-cont">
                <div class="cont-title">
                    <h2><?php  xcho($sname) ?></h2>
                    <div class="fr">
                        <?php if(!empty($nextId)) { ?>
<!--                            <a href="--><?php // xcho(url('/student/student/studentinfo')) ?><!--?student_id=--><?php //xcho($nextId) ?><!--">下一条</a>-->
                            <a href="<?php xcho(url('/student/student/studentinfo')) ?>?student_id=<?php xcho($nextId) ?>" >下一条</a>
                        <?php } ?>
<!--                        <a href="--><?php //xcho(url('/course/Reservation/add')) ?><!--?id=--><?php //xcho($student_id) ?><!--">创建试听</a>-->
                        <a href="<?php xcho(url('/course/Reservation/add')) ?>?id=<?php xcho($student_id) ?>" >创建试听</a>
                        <?php if(!empty($aStudent['gw_id'])) { ?>1
                            <a href="<?php xcho($gw_by_course) ?>?str=<?php xcho($str) ?>&key=<?php xcho($key) ?>" target="_blank">官网购课</a>
                        <?php } ?>
                        <?php if(!empty($aActions['handCourse'])) { ?>
<!--                            <a href="--><?php //xcho(url('/finance/order/handBuyCourse')) ?><!--?student_id=--><?php // xcho($student_id) ?><!--">手动购课</a>-->
                            <a href="<?php xcho(url('/finance/order/handBuyCourse')) ?>?student_id=<?php xcho($student_id) ?>" target="_blank">手动购课</a>
                        <?php } ?>
<!--                        <a href="--><?php //xcho(url('/student/student/info')) ?><!--?student_id=--><?php // xcho($student_id) ?><!--">添加跟踪记录</a>-->
                        <a href="<?php xcho(url('/student/student/info')) ?>?student_id=<?php xcho($student_id) ?>">添加跟踪记录</a>
                        <a href="<?php xcho(url('/student/student/index')) ?>">返回列表</a>
                    </div>
                    
                </div>
                <div class="cont">
                    <ul class="list">
                        <li><a href="<?php xcho($studentinfo) ?>?student_id=<?php xcho($student_id) ?>" >基础信息</a></li>
                        <li><a href="<?php xcho($fol_list) ?>?student_id=<?php xcho($student_id) ?>" >跟踪记录（<?php xcho($count_follow) ?>）</a></li>
                        <li><a href="<?php xcho($courseinfo) ?>?student_id=<?php xcho($student_id) ?>" >TA的课程（<?php xcho($totalCourse) ?>）</a></li>
                        <li><a href="<?php xcho($fol_list) ?>?student_id=<?php xcho($student_id) ?>" >课程表</a></li>
                        <li><a href="<?php xcho(url('/student/student/charges')) ?>?student_id=<?php xcho($student_id) ?>" >收费记录（<?php xcho($count_chargeList) ?>）</a></li>
                        <li><a href="<?php xcho($loglist) ?>?student_id=<?php xcho($student_id) ?>" >修改日志（<?php xcho($editLog) ?>）</a></li>
                    </ul>
                    <div class="cont-tab">
                            <div class="btns-group">
<!--                        <a href="--><?php //xcho(url('/student/student/editstudent')) ?><!--?student_id=--><?php //xcho($student_id) ?><!--">编辑</a>-->
                        <a class="btn btn-sub delete" data-cn_id="<?php xcho($student_id) ?>">删除</a>
                        <a class="btn btn-primary" href="<?php xcho(url('/student/student/editstudent')) ?>?student_id=<?php xcho($student_id) ?>">编辑</a>
                        </div>
                        <div class="reviseLog">
                            <table>
                                <thead>
                                <tr>
                                    <th>订单id</th>
                                    <th>原价</th>
                                    <th>应收</th>
                                    <th>优惠</th>
                                    <th>实收</th>
                                    <th>待收</th>
                                    <th>备注</th>
                                    <th>创建时间</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                   <?php foreach ($chargeList as $v) { ?>
                                       <tr>
                                           <td><?php xcho($v['id']) ?></td>
                                           <td>
                                               <?php if(!empty($v['original_price'])){ ?>
                                               <?php xcho(round($v['original_price']/100,2)) ?>
                                               <?php } ?>
                                           </td>
                                           <td>
                                               <?php if(!empty($v['real_price'])) {?>
                                               <?php xcho(round($v['real_price']/100,2)) ?>
                                                <?php } ?>
                                           </td>
                                           <td>
                                               <?php if(!empty($v['original_price']-$v['real_price'])){ ?>
                                               <?php xcho(round(($v['original_price']-$v['real_price'])/100,2)) ?>
                                             <?php } ?>
                                           </td>
                                           <td>
                                              <?php if(!empty($v['income'])){ ?>
                                               <?php xcho(round($v['income']/100,2)) ?>
                                           <?php } ?>
                                           </td>
                                           <td>
                                              <?php if(!empty($v['real_price']-$v['income'])){ ?>
                                               <?php xcho(round(($v['real_price']-$v['income'])/100,2)) ?>
                                              <?php } ?>
                                           </td>
                                           <td><?php xcho($v['remark']) ?></td>
                                           <td><?php xcho(date('Y-m-d H:i:s',$v['add_time'])) ?></td>
                                           <td>

                                               <?php if(($v['real_price']-$v['income'])>0){ ?>
                                                   <a href="javascript:;" class="bujiao layui-btn-mini" order_id="<?php xcho($v['id']) ?>">补交</a>|
                                                   <a href="<?php xcho(url('/student/student/getStudentChargeDetail')) ?>?order_id=<?php xcho($v['id']) ?>&student_id=<?php xcho($student_id) ?>&ujiao=yes" >详细</a>
                                               <?php }else{ ?>
                                                   <a href="javascript:;" class="layui-btn-mini kaipiao" order_id="<?php xcho($v['id']) ?>">开票</a>|
                                                   <a href="<?php xcho(url('/student/student/getStudentChargeDetail')) ?>?order_id=<?php xcho($v['id']) ?>&student_id=<?php xcho($student_id) ?>&bujiao=no" >详细</a>
                                               <?php } ?>

                                               <a href="javascript:;" class="layui-btn-mini layui-btn-danger cancel" order_id="<?php xcho($v['id']) ?>" actions="cancel">撤单</a>
                                           </td>
                                       </tr>
                                   <?php } ?>

                                </tbody>
                            </table>
                            <div class="pages">

                                <div class="pages-group">
                                    <ul>
                                       <?php  xchoHtml($chargeList->render()) ?>
                                    </ul>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="bujiao-group" tabindex="-1" role="dialog" aria-labelledby="modal-info-label">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header state modal-info">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="modal-info-label"><i class="fa fa-info"></i></h4>
            </div>
            <div class="modal-body layui-forms" style="min-height: 150px;">
                <div class="layui-form-item">
                    <label class="layui-form-label">补交</label>
                    <div class="layui-input-block">
                        <input type="text" name="price" required  lay-verify="required" placeholder="收费金额" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label" >支付方式</label>

                    <div class="layui-input-block">
                        <select id="ptype" name="ptype" >
                            <option value="">请选择</option>
                            <?php foreach ($aPtype as $p) { ?>
                                <option value="<?php xcho($p['dict_value']) ?>"><?php xcho($p['cn_name']) ?></option>
                            <?php } ?>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">待收</label>
                    <div class="layui-form-mid layui-word-aux" id="bujiao_val"></div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">收费日期</label>
                    <div class="layui-input-block">
                        <input type="text" id="ptime" name="ptime" required  lay-verify="required" placeholder="收费金额" autocomplete="off" class="layui-input" value="<?php xcho(date('Y-m-d'),time()) ?>" >
                    </div>
                </div>

                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">添加备注</label>
                    <div class="layui-input-block">
                        <textarea id="remark" name="remark" placeholder="请输入备注" class="layui-textarea"></textarea>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <span type="button" class="btn btn-info" id="saveBujiao" data-dismiss="modal">确定</span>
                <span type="button" class="btn btn-default" id="returnBujiao" data-dismiss="modal">返回</span>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="kaipiao-group" tabindex="-1" role="dialog" aria-labelledby="modal-info-label">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header state modal-info">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="modal-info-label"><i class="fa fa-info"></i></h4>
            </div>
            <div class="modal-body layui-forms" style="min-height: 150px;">
                <div class="layui-form-item">
                    <label class="layui-form-label">发票抬头</label>
                    <div class="layui-input-block">
                        <select id="receipt_title_type" name="receipt_title_type" lay-verify="required">
                            <option value=""></option>
                            <?php foreach ($receiptTitleType as $aTmp) { ?>
                                <option value="<?php xcho($aTmp['dict_value']) ?>"><?php xcho($aTmp['cn_name']) ?></option>
                            <?php } ?>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">抬头信息</label>
                    <div class="layui-input-block">
                        <input type="text" id="receipt_title" name="receipt_title" required
                               lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
                        <input type="hidden" name="save_order_url" >
                    </div>
                </div>

                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">添加备注</label>
                    <div class="layui-input-block">
                        <textarea id="receipt_remark" name="receipt_remark" placeholder="请输入备注" class="layui-textarea"></textarea>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <span type="button" class="btn btn-info" id="saveKaipiao" data-dismiss="modal">确定</span>
                <span type="button" class="btn btn-default" id="returnKaipiao" data-dismiss="modal">取消</span>
            </div>
        </div>
    </div>
</div>
<input type="hidden" id="order_id" name="order_id" value="">
<input type="hidden" id="order_id" name="order_ids" value="">
<input type="hidden" name="order_info" value="<?php xcho($order_info) ?>" />
<input type="hidden" name="ajax_bujiao" value="<?php xcho($ajax_bujiao) ?>" />
<input type="hidden" name="ajax_kaipiao" value="<?php xcho($ajax_kaipiao) ?>" />
<input type="hidden" name="deleteOrder" value="<?php xcho($deleteOrder) ?>" />
<input type="hidden" name="student_id" value="<?php xcho($student_id) ?>" />
<input type="hidden" name="del" value="<?php xcho($del) ?>" />
<script src="<?php xcho(loadSource('/assets/plugins/jquery/jquery.min.js')) ?>"></script>
<script src="<?php xcho(loadSource('/assets/plugins/layui/layui.all.js')) ?>" charset="utf-8"></script>
<script src="<?php xcho(loadSource('/assets/plugins/bootstrap/js/bootstrap.min.js')) ?>"></script>
<script src="<?php xcho(loadSource('/assets/plugins/data-table/media/js/jquery.dataTables.min.js')) ?>"></script>
<script src="<?php xcho(loadSource('/assets/plugins/data-table/media/js/dataTables.bootstrap.min.js')) ?>"></script>
<script src="<?php xcho(loadSource('/assets/plugins/layer-v3.0.3/layer/layer.js')) ?>"></script>
<script
        src="<?php xcho(loadSource('/assets/plugins/data-table/extensions/Responsive/js/dataTables.responsive.min.js')) ?>"></script>
<script
        src="<?php xcho(loadSource('/assets/plugins/data-table/extensions/Responsive/js/responsive.bootstrap.min.js')) ?>"></script>
<script src="<?php xcho(loadSource('/assets/plugins/ztree/js/jquery.ztree.core.js')) ?>"></script>
<script type="text/javascript"
        src="<?php xcho(loadSource('/assets/plugins/ztree/js/jquery.ztree.excheck.js')) ?>"></script>
<script type="text/javascript"
        src="<?php xcho(loadSource('/assets/plugins/ztree/js/jquery.ztree.exedit.js')) ?>"></script>
<script>

    layui.use(['layer', 'form', 'laydate','element'], function () {
        var layer = layui.layer
            , form = layui.form
            ,element = layui.element;
        var laydate = layui.laydate;
        laydate.render({
            elem:"#ptime"
        });
        form.on("select(date_type)", function (data) {
            var ddVal = data.value;
            if (ddVal == "define") {
                $("#begin_start_time").val("");
                $("#end_start_time").val("");
                //执行一个laydate实例
                laydate.render({
                    elem: '#end_start_time', //指定元素
                    showBottom: false
                });
                //执行一个laydate实例
                laydate.render({
                    elem: '#begin_start_time', //指定元素
                    showBottom: false,
                });
            } else {
                var aDate = getDates(ddVal);
                $("#begin_start_time").val(aDate['sStartDate']);
                $("#end_start_time").val(aDate['sEndDate']);
            }
        })
        form.on('checkbox(allChoose)', function (data) {
            var child = $(data.elem).parents('table').find('tbody input[type="checkbox"]');
            child.each(function (index, item) {
                item.checked = data.elem.checked;
            });
            form.render('checkbox');
        });
        form.on('checkbox(itemChoose)', function (data) {
            var sib = $(data.elem).parents('table').find('tbody input[type="checkbox"]:checked').length;
            var total = $(data.elem).parents('table').find('tbody input[type="checkbox"]').length;
            if (sib == total) {
                $(data.elem).parents('table').find('thead input[type="checkbox"]').prop("checked", true);
                form.render();
            } else {
                $(data.elem).parents('table').find('thead input[type="checkbox"]').prop("checked", false);
                form.render();
            }
        });
        $(".group-picker").focus(function(){
            $('#info-modal-group').modal({
                keyboard: false,
                backdrop:false
            });
            $('#info-modal-group').on('shown.bs.modal', function (e) {
                // 关键代码，如没将modal设置为 block，则$modala_dialog.height() 为零
                $(this).css('display', 'block');
                $(this).find('.modal-dialog').css({
                    'margin-top': "100px"
                });
            });
        });
        element.on('tab(checkTab)', function(data){
            $("#receipt_status").val(this.getAttribute('lay-id'));
            $('#search').click();
        });


        $(".bujiao").on('click',function () {
            $("input[name='order_ids']").val($(this).attr('order_id'));
            $('#bujiao-group').modal({
                keyboard: false,
                backdrop: false
            });
            $('#bujiao-group').on('shown.bs.modal', function (e) {
                // 关键代码，如没将modal设置为 block，则$modala_dialog.height() 为零
                $(this).css('display', 'block');
                $(this).find('.modal-dialog').css({
                    'margin-top': "100px"
                });
              var url=$("input[name='order_info']").val();
              var id=$("input[name='order_ids']").val();
              var new_url=url+'?id='+id;
                $.ajax({
                    url: new_url,
                    data: {},
                    type: 'get',
                    dataType: 'json',
                    success: function (data) {
                        if (data.success == 1) {
                            $("#bujiao_val").text((data.data.real_price-data.data.income)/100);
                        } else {

                        }
                    },
                    complete: function () {
                    },
                    error: function () {

                    }
                });
            });
        });

        $(".kaipiao").on('click',function () {
            $("input[name='order_id']").val($(this).attr('order_id'));
            $('#kaipiao-group').modal({
                keyboard: false,
                backdrop: false
            });
            $('#kaipiao-group').on('shown.bs.modal', function (e) {
                // 关键代码，如没将modal设置为 block，则$modala_dialog.height() 为零
                $(this).css('display', 'block');
                $(this).find('.modal-dialog').css({
                    'margin-top': "100px"
                });
            });
        });

    });


    $("#saveBujiao").on('click',function () {
        var aData = {
            'order_id':$("input[name='order_ids").val(),
            'price':($("input[name='price']").val())*100,
            'ptype':$("#ptype").find("option:selected").attr("value"),
            'ptime':$("input[name='ptime']").val(),
            'remark':$("#remark").val(),
        };
        var url=$("input[name='ajax_bujiao']").val();
        var id=$("input[name='order_ids").val();
        var new_url=url+'?id='+id;
        $.ajax({
            url:new_url,
            data:aData,
            type:'POST',
            dataType: 'json',
            success:function (data) {
                if (data.success == 1) {
                    layer.msg('补交成功');
                    setTimeout(function(){ window.location.reload(); }, 3000);
                } else {
                    layer.msg("补交失败");
                }
            }
        });
    });

    $("#saveKaipiao").on('click',function () {
        var aData = {
            'id':$("input[name='order_id']").val(),
            'receipt_title_type':$("#receipt_title_type").find("option:selected").attr("value"),
            'receipt_title':$("#receipt_title").val(),
            'receipt_status':'audit_submit',
            'receipt_remark':$("#receipt_remark").val(),
        };
        $.ajax({
            url:$("input[name='ajax_kaipiao']").val(),
            data:aData,
            type:'POST',
            dataType: 'json',
            success:function (data) {
                if (data.success == 1) {
                    layer.msg('操作成功');
                } else {
                    layer.msg("操作失败");
                }
            }
        });
    });

    //删除
    $(".cancel").click(function () {
        var delVal = $("input[name='deleteOrder']").val();
        var keyId = $(this).attr("order_id");
        var actions = $(this).attr("actions");
        layer.confirm('确定撤单吗？', {icon: 3, title:'提示'}, function(index){
            $.ajax({
                url: delVal,
                data: {
                    id: keyId,
                    actions: actions,
                },
                type: 'POST',
                dataType: 'json',
                success: function (data) {
                    if (data.success == 1) {
                        layer.msg("撤销成功");
                        setTimeout(function(){ window.location.reload(); }, 3000);
                    } else {
                        layer.msg("撤销失败");
                    }
                }
            })
        });
    });

    $(".delete").on("click", function () {
        if (confirm("确定删除本条数据吗？")) {
            var cn_id = $(this).attr("data-cn_id");
            $.ajax({
                url: $("input[name='del']").val(),
                data: {
                    ids: cn_id
                },
                type: 'post',
                dataType: 'json',
                success: function (data) {
                    console.log(data)
                    if (data.success == 1) {
                        layer.alert("删除成功!", {
                            skin: 'layui-layer-molv'
                        }, function () {
                            window.location.href = "/student/student/index";
                            //window.parent.updateParentTab({href:'/student/student/index',title:'学员列表'})
                        })
                    } else {
                        layer.alert(data.msg, {
                            skin: 'layui-layer-molv'
                        }, function () {
//                                window.parent.updateParentTab({href:'/student/student/index',title:'学员列表'})
                        })
                    }
                },
                complete: function () {
                },
                error: function () {

                }
            });
        }
    })

</script>
<?php include_once TPL_PATH . 'public/foot_script.phtml'; ?>
<button id="top" style="height: 50px;width: 50px;"></button></body>

</html>
